/*
 * Rhy Cookies Core Lib
 *
 * @author Tristan Maindron
 * 
 */

Rhy.cookie = {
	set: function(name, val) {
		var expDate = new Date();
		expDate.setTime(expDate.getTime() + (365 * 24 * 3600 * 1000));
		document.cookie = name + "=" + escape(val) + ";expires=" + expDate.toGMTString();
	},
	
	get: function(name) {
        var c = document.cookie;
		var i = c.indexOf(name + "=")
		if (i >= 0) {
			i += name.length + 1;
			j = c.indexOf(";",i);
			if (j < 0) 
				j = c.length;
			return unescape(c.substring(i,j));
		}
		return "";
	}
}

